import sqlite3

# 1.连接数据库
conn = sqlite3.connect('niit.sqlite')
# 2.创建游标
cur = conn.cursor()
# 3.准备sql
sql_insert = 'insert into student (stu_id,stu_name,age) values (10001,"Rose",20)'
# 4.执行sql
cur.execute(sql_insert)
# 5.提交事务
conn.commit()
# 6.关闭连接
conn.close()
print('插入数据成功。。。')
